# -*- mode: python -*-
Import("env")

ftdcEnv = env.Clone()
ftdcEnv.InjectThirdPartyIncludePaths(libraries=['zlib'])

ftdcEnv.Library(
    target='ftdc',
    source=[
        'block_compressor.cpp',
        'collector.cpp',
        'compressor.cpp',
        'controller.cpp',
        'decompressor.cpp',
        'file_manager.cpp',
        'file_reader.cpp',
        'file_writer.cpp',
        'util.cpp',
        'varint.cpp'
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        '$BUILD_DIR/mongo/bson/util/bson_extract',
        '$BUILD_DIR/mongo/db/server_options_core',
        '$BUILD_DIR/mongo/db/service_context',
        '$BUILD_DIR/third_party/s2/s2', # For VarInt
        '$BUILD_DIR/third_party/shim_zlib',
    ],
    LIBDEPS_TAGS=[
        # Needs 'mongo::Validator<mongo::BSONObj>::validateLoad(char const*, unsigned long)'
        'incomplete',
    ],
)

env.Library(
    target='ftdc_mongod',
    source=[
        'ftdc_mongod.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        '$BUILD_DIR/mongo/db/server_parameters',
        'ftdc'
    ],
    LIBDEPS_TAGS=[
        # Needs 'mongo::storageGlobalParams' in storage_options.cpp which is in serveronly
        # And this library is already part of serveronly
        'incomplete',
    ],
)

env.CppUnitTest(
    target='ftdc_test',
    source=[
        'compressor_test.cpp',
        'controller_test.cpp',
        'file_manager_test.cpp',
        'file_writer_test.cpp',
        'ftdc_test.cpp',
        'util_test.cpp',
        'varint_test.cpp',
    ],
    LIBDEPS=[
        'ftdc',
    ],
)
